package cn.xiaohui;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

/*
 * BufferedInputStream和bufferedOutPuStream两个流的用法
 */
public class ExampleTest47 {

	public static void main(String[] args) throws IOException {
		// TODO 自动生成的方法存根
		//带有缓冲区的输入流
    BufferedInputStream biStream=new BufferedInputStream(new FileInputStream("text.txt"));
  //带有缓冲区的输出流
    BufferedOutputStream bOutputStream=new BufferedOutputStream(new FileOutputStream("des.txt"));
    int len;
    while((len=biStream.read())!=-1) {
    	bOutputStream.write(len);	
    }
     biStream.close();
     bOutputStream.close();
	}

}
